<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2017/1/3
 * Time: 13:25
 */

//parse_str — 将字符串解析成多个变量
//void parse_str ( string $str [, array &$arr ] )

$str = "first=value&arr[]=foo+bar&arr[]=baz";
parse_str($str);
echo $first.PHP_EOL;  // value
echo $arr[0].PHP_EOL; // foo bar
echo $arr[1].PHP_EOL; // baz

parse_str($str, $output);
echo $output['first'].PHP_EOL;  // value
echo $output['arr'][0].PHP_EOL; // foo bar
echo $output['arr'][1].PHP_EOL; // baz


parse_str("back.yii2.dev/index.php?r=site%2Flogin",$arr);
var_dump($arr);



echo $_SERVER['SCRIPT_FILENAME'].PHP_EOL;
echo $_SERVER['SCRIPT_NAME'].PHP_EOL;